﻿using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace QueryData;

public class 原始Sql查询
{
    void MyMethod()
    {
        using (var db = new BasicDbContext())
        {
            db.BasicEntities.FromSqlRaw("select * from BasicEntities order by Id").ToList();

            int minId = 3;
            (from x in db.BasicEntities.FromSqlInterpolated($"select * from BasicEntities where Id >= {minId}") orderby x.Id descending select x).ToList();

        }

    }


}
